package cn.tedu.csmall.stock.webapi.quartz;

import cn.tedu.csmall.stock.webapi.mapper.StockMapper;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

public class QuartzStock implements Job {
    @Autowired
    private StockMapper stockMapper;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        stockMapper.updateStockCountByCommodityCode(
                "PC100",-10
        );
        System.out.println("-------------减少库存成功--------------------------");
    }
}
